package mao.thinkinjava.io.serialize;

import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;

public  class Rectangle extends Shape{
    public static int color = Shape.BLUE;
    public Rectangle(int xPos, int yPos, int dim) {
        super(xPos, yPos, dim);
    }

    public  void serializeStaticField(ObjectOutputStream out) throws IOException {
        out.writeObject(color);
    }
    public  void recoverStaticField(ObjectInputStream in) throws IOException, ClassNotFoundException {
        color = (int)in.readObject();
    }
    @Override
    public int getColor() {
        return color;
    }

    @Override
    public void setColor(int color) {
        this.color=color;
    }
}